package howl.types;

import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import twitter4j.http.AccessToken;

import com.google.appengine.api.users.User;
import compiler.HowlType;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class HowlUser {

	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Long id;

	@Persistent
	private boolean firstTimeUser = true;
	
	@Persistent
	private User users;
	
	@Persistent
	private Date lastloggedin;

	@Persistent
	private boolean email;
	
	@Persistent
	private String emailAddress;

	@Persistent
	private boolean Rss;

	@Persistent
	private boolean Twitter;
	
	@Persistent
	private boolean TwitterisConfigured = false;

	@Persistent
	private String twitterToken;

	@Persistent
	private String twitterTokenSecret;
	
	@Persistent
	private String twitterName;

	@Persistent
	private boolean Layar;
	
	@Persistent
	private boolean LayarisConfigured = false;

	@Persistent
	private boolean YourFlowingData;
	
	@Persistent
	private boolean YourFlowingDataisConfigured = false;

	@Persistent
	private boolean Pachube;
	
	@Persistent
	private String PachubeKey;
	
	@Persistent
	private boolean PachubeisConfigured = false;
	
	public HowlUser(User users, boolean email, boolean rss, boolean twitter,
			boolean layar, boolean yourFlowingData, boolean pachube) {
		super();
		this.users = users;
		this.email = email;
		this.emailAddress = users.getEmail().toLowerCase();
		Rss = rss;
		Twitter = twitter;
		Layar = layar;
		YourFlowingData = yourFlowingData;
		Pachube = pachube;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public User getUsers() {
		return users;
	}

	public void setUsers(User users) {
		this.users = users;
	}

	public boolean isEmail() {
		return email;
	}

	public void setEmail(boolean email) {
		this.email = email;
	}

	public boolean isRss() {
		return Rss;
	}

	public void setRss(boolean rss) {
		Rss = rss;
	}

	public boolean isTwitter() {
		return Twitter;
	}

	public void setTwitter(boolean twitter) {
		Twitter = twitter;
	}

	public boolean isLayar() {
		return Layar;
	}

	public void setLayar(boolean layar) {
		Layar = layar;
	}

	public boolean isYourFlowingData() {
		return YourFlowingData;
	}

	public void setYourFlowingData(boolean yourFlowingData) {
		YourFlowingData = yourFlowingData;
	}

	public boolean isPachube() {
		return Pachube;
	}

	public void setPachube(boolean pachube) {
		Pachube = pachube;
	}

	public String getTwitterToken() {
		return twitterToken;
	}

	public void setTwitterToken(String twitterToken) {
		this.twitterToken = twitterToken;
	}

	public String getTwitterTokenSecret() {
		return twitterTokenSecret;
	}

	public void setTwitterTokenSecret(String twitterTokenSecret) {
		this.twitterTokenSecret = twitterTokenSecret;
	}

	public boolean isFirstTimeUser() {
		return firstTimeUser;
	}

	public void setFirstTimeUser(boolean firstTimeUser) {
		if (this.firstTimeUser) {
			this.firstTimeUser = firstTimeUser;
		}
	}

	public boolean isTwitterisConfigured() {
		return TwitterisConfigured;
	}

	public void setTwitterisConfigured(boolean twitterisConfigured) {
		TwitterisConfigured = twitterisConfigured;
	}

	public boolean isLayarisConfigured() {
		return LayarisConfigured;
	}

	public void setLayarisConfigured(boolean layarisConfigured) {
		LayarisConfigured = layarisConfigured;
	}

	public boolean isYourFlowingDataisConfigured() {
		return YourFlowingDataisConfigured;
	}

	public void setYourFlowingDataisConfigured(boolean yourFlowingDataisConfigured) {
		YourFlowingDataisConfigured = yourFlowingDataisConfigured;
	}

	public boolean isPachubeisConfigured() {
		return PachubeisConfigured;
	}

	public void setPachubeisConfigured(boolean pachubeisConfigured) {
		PachubeisConfigured = pachubeisConfigured;
	}

	public Date getLastloggedin() {
		return lastloggedin;
	}

	public void setLastloggedin(Date lastloggedin) {
		this.lastloggedin = lastloggedin;
	}

	public String getTwitterName() {
		return twitterName;
	}

	public void setTwitterName(String twitterName) {
		this.twitterName = twitterName;
	}

	/**
	 * @return the pachubeKey
	 */
	public String getPachubeKey() {
		return PachubeKey;
	}

	/**
	 * @param pachubeKey the pachubeKey to set
	 */
	public void setPachubeKey(String pachubeKey) {
		PachubeKey = pachubeKey;
	}

	/**
	 * @return the emailAddress
	 */
	public String getEmailAddress() {
		return emailAddress;
	}

	/**
	 * @param emailAddress the emailAddress to set
	 */
	public void setEmailAddress(String emailAddress) {
		this.emailAddress = emailAddress;
	}

}
